name: Rust

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: rust-latest

    steps:
    - uses: actions/checkout@v3
    - name: 'Create env file'
      run: |
        touch .env
        echo VK_GROUP_TOKEN="${{ secrets.VK_GROUP_TOKEN }}" >> .env
        echo VK_USER_TOKEN="${{ secrets.VK_USER_TOKEN }}" >> .env
    - name: Build
      run: cargo build --verbose
    - name: Run tests
      run: cargo test --verbose

